package com.wwwc.admin.web.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.sql.SQLException;

import com.wwwc.admin.web.database.*;
import com.wwwc.util.web.*;

public class adminBean {
    public StringBuffer getDatabaseOptionCheckBox(String databases, String database) {
	StringBuffer sbf = new StringBuffer();
	sbf.append("<TABLE style='font-size: 10pt' cellSpacing=0 cellPadding=2>");
	String temp = null;
	StringTokenizer tokens = new StringTokenizer(databases, ",");
	sbf.append("<TR>");
	while (tokens.hasMoreTokens()) {
	    temp = tokens.nextToken();
	    if(database != null && temp.equals(database)) {
		sbf.append("<TD align=center><input type=checkbox name="+temp+" value='"+temp+"' checked>"+temp+"</TD>");
	    }
	    else {
		sbf.append("<TD align=center><input type=checkbox name="+temp+" value='"+temp+"'>"+temp+"</TD>");
	    }
	}
	sbf.append("</TR>");
	sbf.append("</TABLE>");
	return sbf;
    }
}
